#ifndef _DLIST_H_
#define _DLIST_H_

#ifndef NULL
#define NULL (0L)
#endif

template <typename T>
class DList {
private:
	template <typename T>
	struct Node {
		Node<T>* next;
		T item;
		Node<T>* previous;

		Node<T>(T _item) : item(_item), next(NULL), previous(NULL) {}
	};
	
	Node<T>* first;
	Node<T>* last;
	unsigned int size;

public:
	DList<T>(void);
	DList<T>(const DList<T>& that);
	~DList<T>(void);
	DList<T>& operator=(const DList<T>& that);
	T& operator[](unsigned int index);

	void AddFront(const T& item);
	void AddBack(const T& item);
	void RemoveBack(void);
	void RemoveFront(void);
	void RemoveAt(unsigned int index);
	void RemoveAll(void);
	unsigned int Size(void);
};

#include "DList.hpp"

#endif //_SCROLL_H_